/* Floating Customer Service Icon */
.cs-floating-btn {
    position: fixed;
    bottom: 31vh;
    /* Aligned with 联系服务 button */
    right: 30px;
    width: 55px;
    height: 55px;
    background: #221e1d;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    transition: transform 0.2s, box-shadow 0.2s;
}

.cs-floating-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.cs-floating-btn svg {
    width: 28px;
    height: 28px;
    fill: #fff;
}

/* Chat Modal Overlay */
.chat-modal-overlay {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: auto;
    height: auto;
    background: transparent;
    z-index: 30000;
    pointer-events: none;
}

/* Chat Modal Content */
.chat-modal-content {
    width: 505px;
    /* Reduced by 5% */
    height: 500px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    pointer-events: auto;
}

/* Chat Header */
.chat-header {
    background: #221e1d;
    color: #fff;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
}

.close-chat-modal {
    font-size: 24px;
    cursor: pointer;
    color: #fff;
    opacity: 0.8;
}

.close-chat-modal:hover {
    opacity: 1;
}

/* Chat Messages Area */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f9f9f9;
}

.message {
    margin-bottom: 15px;
    max-width: 80%;
}

.message p {
    margin: 0;
    padding: 10px 15px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.system-message {
    align-self: flex-start;
}

.system-message p {
    background: #fff;
    border: 1px solid #eee;
    color: #333;
}

.user-message {
    margin-left: auto;
}

.user-message p {
    background: #221e1d;
    color: #fff;
}

/* Chat Input Area */
.chat-input-area {
    padding: 15px;
    background: #fff;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

#chat-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 10px 15px;
    font-size: 14px;
    outline: none;
}

#chat-input:focus {
    border-color: #221e1d;
}

.send-btn {
    background: #221e1d;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.send-btn:hover {
    background: #333;
}

/* Scrollbar */
.chat-messages::-webkit-scrollbar {
    width: 5px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 5px;
}

/* Attachment Button */
.icon-btn {
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.icon-btn:hover {
    background: #f0f0f0;
}

/* Rich Media Messages */
.message img,
.message video {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 5px;
    display: block;
    border: none;
}

.message .file-attachment {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.05);
    padding: 10px;
    border-radius: 8px;
}

.message .file-icon {
    width: 30px;
    height: 30px;
    background: #ddd;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #555;
    font-weight: bold;
}